import dao.OrderDao;
import dao.UserDao;
import entity.Order;
import entity.User;
import factory.Configuration;
import factory.DefaultSqlSessionFactory;
import factory.SqlSession;

public class Test {

    public static void main(String[] args) {
        String fileName = "./config/mybatis-cfg.xml";

        Configuration configuration = new Configuration(fileName);

        DefaultSqlSessionFactory factory = new DefaultSqlSessionFactory(configuration);

        SqlSession sqlSession = factory.getSqlSession();

        /*UserDao userDao = sqlSession.getMapper(UserDao.class);

        userDao.updateUserById("asdasdsd", 123);

        User user = userDao.findById(123);

        System.out.println(user.toString());*/

        OrderDao orderDao = sqlSession.getMapper(OrderDao.class);
        Order order = orderDao.findById(123);

        System.out.println(order.toString());
    }

}
